#pragma once
#include "Common.hpp"
class Client
{
        public:
    Client()
        : _fd(defaultfd) {}
    bool OpenPipe()
    {
        _fd = open(PipeFile.c_str(), O_WRONLY);
        if (_fd < 0)
        {
            cerr << " Client open Error" << endl;
            return false;
        }
        return true;
    }
    int SentPipe(string &in)
    {
        return write(_fd, in.c_str(), in.size());
    }
    void ClosePipe()
    {
        if (_fd >= 0)
            close(_fd);
    }
    ~Client()
    {
    }

private:
    int _fd;
};